﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WorkStation.Frameworks.EasyBus.DbModel;

namespace WorkStation.Frameworks.EasyBus.Repositories
{
    /// <summary>
    /// 消息历史记录中心仓储接口
    /// </summary>
    public interface IHistoryCenterRepository : IDisposable
    {
        /// <summary>
        /// 上传消息日志
        /// </summary>
        /// <param name="log">消息日志</param>
        void UploadMessageLog(MessageLog log);

        /// <summary>
        /// 更新消息日志的发布标志位
        /// </summary>
        /// <param name="messageId">消息编号</param>
        /// <param name="value">值</param>
        void UpdateIsSuccessPublish(string messageId, bool value);

        /// <summary>
        /// 更新消息日志的处理标志位
        /// </summary>
        /// <param name="messageId">消息编号</param>
        /// <param name="value">值</param>
        void UpdateIsSuccessProcess(string messageId, bool value);

        /// <summary>
        /// 上传消息发布日志
        /// </summary>
        /// <param name="log">发布日志</param>
        void UploadMessagePublishLog(MessagePublishLog log);

        /// <summary>
        /// 上传消息处理日志 
        /// </summary>
        /// <param name="log">处理日志</param>
        void UploadMessageProcessLog(MessageProcessLog log);

        /// <summary>
        /// 获取消息日志
        /// </summary>
        /// <param name="messageId">消息编号</param>
        /// <returns></returns>
        MessageLog GetMessageLogById(string messageId);

        /// <summary>
        /// 获取消息发布日志
        /// </summary>
        /// <param name="messageId">消息编号</param>
        /// <returns></returns>
        List<MessagePublishLog> GetMessagePublishLogById(string messageId);

        /// <summary>
        /// 获取消息处理日志
        /// </summary>
        /// <param name="messageId">消息编号</param>
        /// <returns></returns>
        List<MessageProcessLog> GetMessageProcessLogById(string messageId);

        /// <summary>
        /// 获取异常的发布日志
        /// </summary>
        /// <returns></returns>
        List<MessageLog> GetExceptionPublishLog();

        /// <summary>
        /// 获取异常的处理日志
        /// </summary>
        /// <returns></returns>
        List<MessageLog> GetExceptionProcessLog();
    }
}
